home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 2856.ZIP / KTERRORS.PAS < prev    next >
Pascal/Delphi Source File  |  1992-05-11  |  3KB  |  84 lines

  1. unit kterrors;
  2. { MAY      1991                             version 3*/
  3.  
  4. /****************************************************************************
  5. *                                        *
  6. *    KeyTree Utilities Error Messages                    *
  7. *                                        *
  8. *    Copyright 1991 by Rewse Consultants Limited                *
  9. *                                        *
  10. *  The KeyTree Utilities are issued as shareware. In case you are unaware   *
  11. *  of how the shareware system works, it is NOT 'free' software.        *
  12. *  No initial charge is made for the software, so that you can try it out   *
  13. *  without obligation. However, if you continue to use the software (and in *
  14. *  the case of the KeyTree Utilities, use programs created using them),     *
  15. *  then you are required to pay a registration fee. To register your use of *
  16. *  the KeyTree Utilities, we ask you to pay a miserly £30 (UK Pounds), a    *
  17. *  mere fraction of the cost that you are saving in time and effort. Please *
  18. *  send your registration fee to :                        *
  19. *                                        *
  20. *    Rewse Consultants Limited                        *
  21. *    44, Horseshoe Road, Pangbourne, Reading, Berkshire RG8 7JL, UK      *
  22. ****************************************************************************/}
  23.  
  24. interface
  25.  
  26. uses KeyTree;
  27.  
  28. type
  29.  
  30. ktsptr = string[30];
  31.  
  32. function ktError : ktsptr;
  33.  
  34. implementation
  35.  
  36. type star = array[0..30] of string[30];
  37. const
  38.  
  39. kt_error_str : star = ('no errors',                { 0  }
  40.         'file already exists',                  { 1  }
  41.         'no such file',                { 2  }
  42.         'not a KeyTree file',            { 3  }
  43.         'invalid index number',            { 4  }
  44.         'too many files open',            { 5  }
  45.         'file is corrupt',            { 6  }
  46.         'insufficient memory',            { 7  }
  47.         'cannot read index data',        { 8  }
  48.         'file is not open',            { 9  }
  49.         'access denied',            { 10 }
  50.         '',                    { 11 }
  51.         'file open for reading only',        { 12 }
  52.         'invalid parameters',            { 13 }
  53.         '',                    { 14 }
  54.         'invalid record length',        { 15 }
  55.         '',                    { 16 }
  56.         'no record with this key',        { 17 }
  57.         'cannot read record',            { 18 }
  58.         'physical end of file reached',        { 19 }
  59.         'record not yet read',            { 20 }
  60.         'physical start of file reached',    { 21 }
  61.         'record is locked',            { 22 }
  62.         'record chains not allowed',        { 23 }
  63.         '',                    { 24 }
  64.         'no ktReadAll issued yet',        { 25 }
  65.         'logical end of file reached',        { 26 }
  66.         'logical start of file reached',    { 27 }
  67.         'record is deleted',            { 28 }
  68.         'record is not deleted',        { 29 }
  69.         'duplicate key in index %'        { 30 and onwards }
  70. );
  71. function ktError : ktsptr;
  72. var x : integer;
  73.     a : char;
  74. begin
  75.     if ktERRNO >= 30 then
  76.     begin a := #48;
  77.               Inc(a,ktERRNO mod 10);
  78.               kt_error_str[30][24] := a;
  79.           x := 30;
  80.     end
  81.     else  x := ktERRNO;
  82.     ktError := kt_error_str[x];
  83. end;
  84. end.